﻿
namespace Nova_Common {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    using System.Net;
    using System.Runtime.InteropServices;
    using System.Linq;
    using System.Web;
    using System.Xml.Linq;
    using System.Data;
    using System.Data.SqlClient;
    using System.Data.Common;
    using System.Text;
    using System.Web.UI;
    

    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="SI_gi_result_lw_tjBinding", Namespace="urn:NDPaper.com:I_WMS:gi_result_lw_tj")]
    public partial class SI_gi_result_lw_tjService : System.Web.Services.Protocols.SoapHttpClientProtocol {

        //**********************************读写ini 文件********************************
        [DllImport("kernel32")]
        private static extern void WritePrivateProfileString(string section, string key, string val, string filePath);

        [DllImport("kernel32")]
        private static extern int GetPrivateProfileString(string section, string key,
                                                          string def, StringBuilder retVal, int size, string filepath);

        //取值 
        private static string getValue(string key)
        {
            StringBuilder sb = new StringBuilder(500);
            GetPrivateProfileString("DBConStr", key, "", sb, 500, HttpContext.Current.Server.MapPath("SAPServiceSet.ini"));
            return sb.ToString();
        }

        //写入
        private void setValue()
        {
            WritePrivateProfileString("DBConStr", "Ip", "10.180.225.111",HttpContext.Current.Server.MapPath("SAPServiceSet.ini"));
            WritePrivateProfileString("DBConStr", "Port", "50000", HttpContext.Current.Server.MapPath("SAPServiceSet.ini"));
            WritePrivateProfileString("DBConStr", "User", "TJLWZDC", HttpContext.Current.Server.MapPath("SAPServiceSet.ini"));
            WritePrivateProfileString("DBConStr", "Pwd", "init1234", HttpContext.Current.Server.MapPath("SAPServiceSet.ini"));
        }
        
        private System.Threading.SendOrPostCallback SI_gi_result_lw_tjOperationCompleted;
        
        /// <remarks/>
        public SI_gi_result_lw_tjService() {
            this.Url = "http://" + getValue("Ip") + ":" + getValue("Port") + "/XISOAPAdapter/MessageServlet?channel=:BS_TJ_WMS:cc_so" +
                "ap_gi_result_lw_tj&version=3.0&Sender.Service=BS_TJ_WMS&Interface=urn%3ANDPaper." +
                "com%3AI_WMS%3Agi_result_lw_tj%5ESI_gi_result_lw_tj";

            //this.Url = "http://10.180.225.111:50000/XISOAPAdapter/MessageServlet?channel=:BS_TJ_WMS:cc_so" +
            //    "ap_gi_result_lw_tj&version=3.0&Sender.Service=BS_TJ_WMS&Interface=urn%3ANDPaper." +
            //    "com%3AI_WMS%3Agi_result_lw_tj%5ESI_gi_result_lw_tj";
            
        }
        
        /// <remarks/>
        public event SI_gi_result_lw_tjCompletedEventHandler SI_gi_result_lw_tjCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://sap.com/xi/WebService/soap1.1", OneWay=true, Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
        public void SI_gi_result_lw_tj([System.Xml.Serialization.XmlArrayAttribute(Namespace="urn:NDPaper.com:I_WMS:gi_result_lw_tj")] [System.Xml.Serialization.XmlArrayItemAttribute("ROW", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] DT_gi_result_lw_tjROW[] MT_gi_result_lw_tj) {
            //ICredentials credentials = new NetworkCredential("TJLWZDC","init1234");
            ICredentials credentials = new NetworkCredential(getValue("User"), getValue("Pwd"));
            this.Credentials = credentials;
            this.Invoke("SI_gi_result_lw_tj", new object[] {
                        MT_gi_result_lw_tj});
            
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginSI_gi_result_lw_tj(DT_gi_result_lw_tjROW[] MT_gi_result_lw_tj, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("SI_gi_result_lw_tj", new object[] {
                        MT_gi_result_lw_tj}, callback, asyncState);
            
        }
        
        /// <remarks/>
        public void EndSI_gi_result_lw_tj(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
        
        /// <remarks/>
        public void SI_gi_result_lw_tjAsync(DT_gi_result_lw_tjROW[] MT_gi_result_lw_tj) {
            this.SI_gi_result_lw_tjAsync(MT_gi_result_lw_tj, null);
        }
        
        /// <remarks/>
        public void SI_gi_result_lw_tjAsync(DT_gi_result_lw_tjROW[] MT_gi_result_lw_tj, object userState) {
            if ((this.SI_gi_result_lw_tjOperationCompleted == null)) {
                this.SI_gi_result_lw_tjOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSI_gi_result_lw_tjOperationCompleted);
            }
            this.InvokeAsync("SI_gi_result_lw_tj", new object[] {
                        MT_gi_result_lw_tj}, this.SI_gi_result_lw_tjOperationCompleted, userState);
        }
        
        private void OnSI_gi_result_lw_tjOperationCompleted(object arg) {
            if ((this.SI_gi_result_lw_tjCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SI_gi_result_lw_tjCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:NDPaper.com:I_WMS:gi_result_lw_tj")]
    public partial class DT_gi_result_lw_tjROW {
        
        private string seq_noField;
        
        private string document_noField;
        
        private string item_noField;
        
        private string movement_typeField;
        
        private string special_indicatorField;
        
        private string order_numberField;
        
        private string part_noField;
        
        private string companyField;
        
        private string valuation_typeField;
        
        private string storage_locField;
        
        private string lot_batch_noField;
        
        private string vendor_noField;
        
        private string po_noField;
        
        private string plan_quantityField;
        
        private string issue_dateField;
        
        private string issue_timeField;
        
        private string entry_userField;
        
        private string actual_quantityField;
        
        private string actual_wms_dateField;
        
        private string actual_wms_timeField;
        
        private string wms_entry_userField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string seq_no {
            get {
                return this.seq_noField;
            }
            set {
                this.seq_noField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string document_no {
            get {
                return this.document_noField;
            }
            set {
                this.document_noField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string item_no {
            get {
                return this.item_noField;
            }
            set {
                this.item_noField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string movement_type {
            get {
                return this.movement_typeField;
            }
            set {
                this.movement_typeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string special_indicator {
            get {
                return this.special_indicatorField;
            }
            set {
                this.special_indicatorField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string order_number {
            get {
                return this.order_numberField;
            }
            set {
                this.order_numberField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string part_no {
            get {
                return this.part_noField;
            }
            set {
                this.part_noField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string company {
            get {
                return this.companyField;
            }
            set {
                this.companyField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string valuation_type {
            get {
                return this.valuation_typeField;
            }
            set {
                this.valuation_typeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string storage_loc {
            get {
                return this.storage_locField;
            }
            set {
                this.storage_locField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string lot_batch_no {
            get {
                return this.lot_batch_noField;
            }
            set {
                this.lot_batch_noField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string vendor_no {
            get {
                return this.vendor_noField;
            }
            set {
                this.vendor_noField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string po_no {
            get {
                return this.po_noField;
            }
            set {
                this.po_noField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string plan_quantity {
            get {
                return this.plan_quantityField;
            }
            set {
                this.plan_quantityField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string issue_date {
            get {
                return this.issue_dateField;
            }
            set {
                this.issue_dateField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string issue_time {
            get {
                return this.issue_timeField;
            }
            set {
                this.issue_timeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string entry_user {
            get {
                return this.entry_userField;
            }
            set {
                this.entry_userField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string actual_quantity {
            get {
                return this.actual_quantityField;
            }
            set {
                this.actual_quantityField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string actual_wms_date {
            get {
                return this.actual_wms_dateField;
            }
            set {
                this.actual_wms_dateField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string actual_wms_time {
            get {
                return this.actual_wms_timeField;
            }
            set {
                this.actual_wms_timeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string wms_entry_user {
            get {
                return this.wms_entry_userField;
            }
            set {
                this.wms_entry_userField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    public delegate void SI_gi_result_lw_tjCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}
